package com.gm.baseplatform.testing;

import com.gm.baseplatform.core.utils.ApplicationContextUtil;
import com.gm.baseplatform.core.web.BaseActionSupport;

public class UserAction extends BaseActionSupport {

	private static final long serialVersionUID = 1L;
	
	private User user;
	
    public void setUser(User user) {
		this.user = user;
	}
    
    public User getUser() {
		return user;
	}

	private String userName;
    private String userPwd;

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public void setUserPwd(String userPwd) {
		this.userPwd = userPwd;
	}

	public String addUser() {
    	
		UserManager userManager = (UserManager)ApplicationContextUtil
		      .getApplicationContext().getBean("userManager");
		
		userManager.addUser(user);
		
	    userManager.getUserByUnid(user.getUnid());
		
//    	System.out.println("userUnid:" + user.getUnid());
//    	System.out.println("userName:" + user.getUserName());
//    	System.out.println("userPwd:" + user.getUserPwd());
    	
    	return SUCCESS;
    }
}
